<?php
$template->login = array();
if( @Login::checkLoginStatus() == @Login::USER_LOGGED_IN ){
	$template->login = array( 'name' => Login::getUserInfo( 'name' ),
		'link' => 'http://' . Login::getUserInfo( 'login' ) . '.' . HOST_NAME );
}


$template->logoutLink = $logoutLink = 'http://' . HOST_NAME . '/logout/';

$mainHostUri = 'http://www.' . HOST_NAME;

$mainNav = array();
$mainNav[ 'home' ] = array( 'text' => 'Home', 'link' => $mainHostUri, 'class' => '' );
$mainNav[ 'expense-add' ] = array( 'text' => 'Add Expense', 'link' => '/expense-add/', 'class' => '' );
$mainNav[ 'expenses' ] = array( 'text' => 'Expenses', 'link' => '/expenses/', 'class' => '' );
//$mainNav[ 'report' ] = array( 'text' => 'Report', 'link' => '/report/', 'class' => '' );
$mainNav[ 'team-report' ] = array( 'text' => 'Team Report', 'link' => '/team-report/', 'class' => '' );
$mainNav[ 'logout' ] = array( 'text' => 'Logout', 'link' => $logoutLink, 'class' => '' );

$uriArray = Url::getSplittedDomainURI();
$selectedNav = $uriArray[0] == '' ? $uriArray[1] : $uriArray[0];
if( isset( $mainNav[ $selectedNav ] ) ){
	$mainNav[ $selectedNav ][ 'class' ] = 'selected';
}
$template->mainNav = $mainNav;
